-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feature/ctrl enter send #8556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/ctrl enter send #8556
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention before merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a couple of small issues to address before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention before merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found one issue that needs attention before merge.
| case "requireCtrlEnterToSend": | ||
| await updateGlobalState("requireCtrlEnterToSend", message.bool) | ||
| // No need to call postStateToWebview here as the UI already updated optimistically | ||
| break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Setting change doesn't propagate to the webview. The extension updates global state but doesn't notify the frontend, so Chat won't reflect the new behavior until a later state refresh. After updating, also post a message back to the webview so ExtensionStateContext can update immediately.
| case "requireCtrlEnterToSend": | |
| await updateGlobalState("requireCtrlEnterToSend", message.bool) | |
| // No need to call postStateToWebview here as the UI already updated optimistically | |
| break | |
| case "requireCtrlEnterToSend": | |
| await updateGlobalState("requireCtrlEnterToSend", message.bool) | |
| await provider.postMessageToWebview({ type: "requireCtrlEnterToSend", bool: message.bool ?? false }) | |
| break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am following the other UI checkbox; the other doesn't do this, so I believe this one shouldn't either.
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention before merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention before merge.
f6e5d9b to
9422644
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. It is functionally sound and macOS-compatible (checks event.metaKey).
Suggestions:
-
Platform-aware labels: show "Cmd+Enter" on macOS and "Ctrl+Enter" elsewhere. Update
webview-ui/src/components/settings/UISettings.tsxandwebview-ui/src/components/chat/ChatTextArea.tsx. -
i18n: unify strings; prefer a placeholder like
{primaryMod}+Enterinwebview-ui/src/i18n/locales/en/settings.jsonand resolve at runtime so locales don't hardcode Ctrl. -
UX hint: when enabled, show a subtle hint near the input or send button, e.g. "Press Cmd/Ctrl+Enter to send".
Nice work!
|
Understood, I'll take a look at this shortly |
|
I have addressed the feedback. What do you think of the current changes? |
|
Found 1 critical issue remaining: Critical Issues (Must Fix):
Recently Fixed:
Mention @roomote in a comment to trigger your PR Fixer agent and make changes to this pull request. |
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
|
@daniel-lxs any chance we can get this out? |
| "ui": { | ||
| "collapseThinking": { | ||
| "label": "Comprimi i messaggi di pensiero per impostazione predefinita", | ||
| "description": "Se abilitato, i blocchi di pensiero verranno compressi per impostazione predefinita finché non interagisci con essi" | ||
| "requireCtrlEnterToSend": { | ||
| "label": "Richiedi {primaryMod}+Invio per inviare messaggi", | ||
| "description": "Quando abilitato, devi premere {primaryMod}+Invio per inviare messaggi invece di solo Invio" | ||
| "description": "Quando abilitato, devi premere Ctrl+Invio per inviare messaggi invece di solo Invio" | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P0] Critical: Invalid JSON structure. The Italian locale file has malformed JSON with missing closing brace for collapseThinking object and duplicate description keys. This will cause JSON parsing errors and break the application.
| "ui": { | |
| "collapseThinking": { | |
| "label": "Comprimi i messaggi di pensiero per impostazione predefinita", | |
| "description": "Se abilitato, i blocchi di pensiero verranno compressi per impostazione predefinita finché non interagisci con essi" | |
| "requireCtrlEnterToSend": { | |
| "label": "Richiedi {primaryMod}+Invio per inviare messaggi", | |
| "description": "Quando abilitato, devi premere {primaryMod}+Invio per inviare messaggi invece di solo Invio" | |
| "description": "Quando abilitato, devi premere Ctrl+Invio per inviare messaggi invece di solo Invio" | |
| } | |
| } | |
| "ui": { | |
| "collapseThinking": { | |
| "label": "Comprimi i messaggi di pensiero per impostazione predefinita", | |
| "description": "Se abilitato, i blocchi di pensiero verranno compressi per impostazione predefinita finché non interagisci con essi" | |
| }, | |
| "requireCtrlEnterToSend": { | |
| "label": "Richiedi {primaryMod}+Invio per inviare messaggi", | |
| "description": "Quando abilitato, devi premere {primaryMod}+Invio per inviare messaggi invece di solo Invio" | |
| } | |
| } |
| "requireCtrlEnterToSend": { | ||
| "label": "Erfordert {primaryMod}+Enter zum Senden von Nachrichten", | ||
| "description": "Wenn aktiviert, musst du {primaryMod}+Enter drücken, um Nachrichten zu senden, anstatt nur Enter." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Translation inconsistency: German locale still uses hardcoded "Strg+Enter" instead of the dynamic {primaryMod} placeholder. This causes incorrect key combination display for macOS users (should show "Cmd+Enter").
| "requireCtrlEnterToSend": { | |
| "label": "Erfordert {primaryMod}+Enter zum Senden von Nachrichten", | |
| "description": "Wenn aktiviert, musst du {primaryMod}+Enter drücken, um Nachrichten zu senden, anstatt nur Enter." | |
| "requireCtrlEnterToSend": { | |
| "label": "Erfordert {primaryMod}+Enter zum Senden von Nachrichten", | |
| "description": "Wenn aktiviert, musst du {primaryMod}+Enter drücken, um Nachrichten zu senden, anstatt nur Enter." |
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
|
Opened follow-up PR to land fixes since the original is from a fork and not pushable here: #9078 |
|
Superseded by #9078 |
|
Thank you |
Related GitHub Issue
Closes: #8555
Description
This PR introduces a new toggle in the settings under the "UI" section that allows users to switch between two input behaviors in the chat prompt editor:
The change is implemented by listening to the keydown event in the prompt input component and conditionally intercepting the Enter key based on the user’s preference, which is stored via VS Code’s configuration API.
This addresses user pain points around accidental submissions, ergonomic fatigue from holding Shift, and conflicts with input method workflows.
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
The settings panel

Didn't send the message after pressing enter:

Did send it when pressing ctrl+enter

Documentation Updates
Additional Notes
Get in Touch
Discord: lmtr0
Important
Adds a new setting
requireCtrlEnterToSendto toggle input behavior in the chat prompt editor, allowing users to require Ctrl+Enter to send messages.requireCtrlEnterToSendsetting to toggle input behavior in chat prompt editor.ChatTextArea.tsx, modifieshandleKeyDownto conditionally send messages based onrequireCtrlEnterToSend.requireCtrlEnterToSendtoglobalSettingsSchemainglobal-settings.ts.UISettings.tsxto include a checkbox forrequireCtrlEnterToSend.SettingsView.tsxto handlerequireCtrlEnterToSendstate.ExtensionStateContext.tsxto managerequireCtrlEnterToSendstate.webviewMessageHandler.tsto handlerequireCtrlEnterToSendmessages.requireCtrlEnterToSendinsettings.json.This description was created by
for 9d206cb. You can customize this summary. It will automatically update as commits are pushed.